﻿<%@ Page Title="Accueil" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Prixtest.aspx.cs" Inherits="Cirrus.Prixtest" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="Id" 
        DataSourceID="SqlDataSource1" 
        EmptyDataText="There are no data records to display.">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                ShowSelectButton="True" />
            <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" 
                ReadOnly="True" SortExpression="Id" />
            <asp:BoundField DataField="ItemId" HeaderText="ItemId" 
                SortExpression="ItemId" />
            <asp:BoundField DataField="MarchandId" HeaderText="MarchandId" 
                SortExpression="MarchandId" />
            <asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
            <asp:CheckBoxField DataField="Special" HeaderText="Special" 
                SortExpression="Special" />
            <asp:BoundField DataField="Prix" HeaderText="Prix" SortExpression="Prix" />
            <asp:BoundField DataField="Unite" HeaderText="Unite" SortExpression="Unite" />
            <asp:BoundField DataField="Quantite" HeaderText="Quantite" 
                SortExpression="Quantite" />
        </Columns>
    </asp:GridView>
    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
        DataKeyNames="Id" DataSourceID="SqlDataSource1" DefaultMode="Insert" 
        Height="50px" Width="125px" AllowPaging="True">
        <Fields>
            <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" 
                ReadOnly="True" SortExpression="Id" />
            <asp:BoundField DataField="ItemId" HeaderText="ItemId" 
                SortExpression="ItemId" />
            <asp:BoundField DataField="MarchandId" HeaderText="MarchandId" 
                SortExpression="MarchandId" />
            <asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
            <asp:CheckBoxField DataField="Special" HeaderText="Special" 
                SortExpression="Special" />
            <asp:BoundField DataField="Prix" HeaderText="Prix" SortExpression="Prix" />
            <asp:BoundField DataField="Unite" HeaderText="Unite" SortExpression="Unite" />
            <asp:BoundField DataField="Quantite" HeaderText="Quantite" 
                SortExpression="Quantite" />
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                ShowInsertButton="True" />
        </Fields>
    </asp:DetailsView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:CirrusConnectionString1 %>" 
        DeleteCommand="DELETE FROM [Prix] WHERE [Id] = @Id" 
        InsertCommand="INSERT INTO [Prix] ([ItemId], [MarchandId], [Date], [Special], [Prix], [Unite], [Quantite]) VALUES (@ItemId, @MarchandId, @Date, @Special, @Prix, @Unite, @Quantite)" 
        ProviderName="<%$ ConnectionStrings:CirrusConnectionString1.ProviderName %>" 
        SelectCommand="SELECT [Id], [ItemId], [MarchandId], [Date], [Special], [Prix], [Unite], [Quantite] FROM [Prix]" 
        UpdateCommand="UPDATE [Prix] SET [ItemId] = @ItemId, [MarchandId] = @MarchandId, [Date] = @Date, [Special] = @Special, [Prix] = @Prix, [Unite] = @Unite, [Quantite] = @Quantite WHERE [Id] = @Id">
        <DeleteParameters>
            <asp:Parameter Name="Id" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="ItemId" Type="Int32" />
            <asp:Parameter Name="MarchandId" Type="Int32" />
            <asp:Parameter Name="Date" Type="DateTime" />
            <asp:Parameter Name="Special" Type="Boolean" />
            <asp:Parameter Name="Prix" Type="Decimal" />
            <asp:Parameter Name="Unite" Type="String" />
            <asp:Parameter Name="Quantite" Type="Double" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="ItemId" Type="Int32" />
            <asp:Parameter Name="MarchandId" Type="Int32" />
            <asp:Parameter Name="Date" Type="DateTime" />
            <asp:Parameter Name="Special" Type="Boolean" />
            <asp:Parameter Name="Prix" Type="Decimal" />
            <asp:Parameter Name="Unite" Type="String" />
            <asp:Parameter Name="Quantite" Type="Double" />
            <asp:Parameter Name="Id" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>

</asp:Content>
